package gatoropoly.game.action;

import gatoropoly.game.Gatoropoly;
import gatoropoly.game.Game;

public class LeaveGameAction extends GatoropolyClientAction {

	public LeaveGameAction(Gatoropoly client) {
		super(client, "Leave Game");
	}

	public void perform() {
		client.leaveGame();
	}

	public boolean canPerform() {
		if( !super.canPerform() )
			return false;
		
		Game game = self().getGame();
		return game != null && game.getStatus() == Game.Status.CONFIG;
	}

}
